export function createNextGetter<T>(list: T[]): (() => T) {
  let tempList: T[] = [];
  return () => {
    if (!tempList.length) {
      tempList = [...list];
    }
    return tempList.shift()!;
  };
}
